//
// Radio and Checkbox
// --------------------------------------------------


label.radio, 
label.checkbox {
    position: relative;
    display: inline-block;
    height: 20px;
    line-height: 20px;

    [type="radio"], 
    [type="checkbox"] {
        display: none;
    }
}

// radio
label.radio {
    [type="radio"] + span {
        display: block;
        padding-left: 22px;
        cursor: pointer;

        &:before, 
        &:after {
            content: '';
            position: absolute;
            left: 0;
            top: 2px;
            width: 16px;
            height: 16px;
            background-color: #fff;
            border-radius: 50%;
            border: 1px solid #aaa;
            transition: .28s;
        }
    }

    [type="radio"]:checked + span {
        &:before {
            border-color: @primary-color;
        }

        &:after {
            border-radius: 50%;
            border: 2px solid @primary-color;
            background-color: @primary-color;
            -webkit-transform: scale(.5);
            transform: scale(.5);
        }
    }

    [type="radio"]:disabled + span {
    	color: @text-color-disabled;
    	cursor: default;

        &:before,
        &:after {
            border-color: @text-color-disabled;
        }
    }
}

// checkbox
label.checkbox {
    [type="checkbox"] + span {
        display: block;
        padding-left: 22px;
        cursor: pointer;

        &:before,
        &:after {
            content: '';
            position: absolute;
            transition: .16s;
        }

        &:before {
            width: 14px;
            height: 14px;
            top: 3px;
            left: 0;
            background-color: #fff;
            border: 1px solid #aaa;
            border-radius: 2px;
        }

        &:after {
            width: 0;
            height: 0;
            top: 12px;
            left: 6px;
            border: 3px solid transparent;
            -webkit-transform: rotateZ(37deg);
            transform: rotateZ(37deg);
            -webkit-transform-origin: 20% 40%;
            transform-origin: 100% 100%;
        }
    }

    [type="checkbox"]:checked + span {
        &:before {
            border-color: @primary-color;
            background-color: @primary-color;
        }

        &:after {
            top: 4px;
            left: 0px;
            width: 6px;
            height: 10px;
            border-top: 1px solid transparent;
            border-left: 1px solid transparent;
            border-right: 2px solid #fff;
            border-bottom: 2px solid #fff;
            -webkit-transform: rotateZ(37deg);
            transform: rotateZ(37deg);
            -webkit-transform-origin: 100% 100%;
            transform-origin: 100% 100%;
        }
    }
    
    [type="checkbox"]:disabled + span {
    	color: @text-color-disabled;
    	cursor: default;

        &:before {
            border-color: @text-color-disabled;
        }
    }
}

.radio-group {
    display: block;
    height: @input-height-base;
    line-height: @input-height-base;

    label.radio {
        margin-right: 12px;
    }
}

// checkbox in table
th label.checkbox,
td label.checkbox {
    display: block;
    width: 20px;
}